import React, { Component } from 'react';
import BaseComponent from '@/components/BaseComponent';
import { defDrawerWidth } from '@/defaultSettings';
import { Descriptions, Drawer, Tabs } from 'antd';
import styles from './index.less';

const { TabPane } = Tabs;

class PreviewView extends BaseComponent {
  constructor(props) {
    super(props);
    this.state = {
      activeKey: '1',
    };
  }

  render() {
    const { onClose, visible = false, record } = this.props;
    return (
      <Drawer
        title="预览"
        placement="right"
        width={defDrawerWidth}
        closable={true}
        onClose={() => {
          if (onClose) {
            onClose();
          }
        }}
        visible={visible}
      >
        <Descriptions bordered column={2}>
          <Descriptions.Item label="企业名称">{record.company_name}</Descriptions.Item>
          <Descriptions.Item label="法人代表">{record.corporate}</Descriptions.Item>
          <Descriptions.Item label="联系方式">{record.phone}</Descriptions.Item>
          <Descriptions.Item label="地址">{record.address}</Descriptions.Item>
          <Descriptions.Item label="企业类型">
            {record.company_type == 1 ? '产废企业' : ' '}
          </Descriptions.Item>
          <Descriptions.Item label="视频路径">{record.url}</Descriptions.Item>
        </Descriptions>
      </Drawer>
    );
  }
}

export default PreviewView;
